<template>
	<div>
		<el-table :data="dataList" style="width: 100%" size="small">
			<el-table-column type="expand">
				<div slot-scope="props" style="padding:10px 40px;">
					<div v-for="(item,index) in props.row.wasteList" :key="index" class="mb10">
						<span class="mr20">{{item.wasteName}}{{item.wasteCode}}</span>
						<span>{{item.amount}}{{item.unitValue}}</span>
					</div>
				</div>
			</el-table-column>
			<el-table-column label="危废仓库" prop="storageName">
			</el-table-column>
			<el-table-column label="仓库编号" prop="storageNum">
			</el-table-column>
			<el-table-column label="数量" prop="amountStr">
			</el-table-column>
			<el-table-column label="操作" width="100">
				<template slot-scope="scope">
					<el-button @click="handleClick(scope.row)" type="text" size="small">查看详情</el-button>
				</template>
			</el-table-column>
		</el-table>
	</div>
</template>

<script>
	let that

	export default {
		components: {},
		data() {
			return {
				params: {
					ticketId: '',
				},
				dataList: []
			}
		},

		mounted: function() {
			that = this
			that.params.ticketId = that.$store.state.token
			that.getStorageList()
		},

		methods: {

			handleClick(item) {
				that.$router.push("/waste/wasteReserveDetail?storageId=" + item.storageId+"&storageName="+item.storageName)
			},

			getStorageList() {
				that.ajax({
					url: '/hw/warehouseReceipt/getStorageList?ticketId=' + that.params.ticketId,
					data: JSON.stringify({
						ticketId: that.params.ticketId,
					}),
					contentType: 'application/json',
					success: function(result) {
						if (result.data) {
							that.dataList = result.data
						}
					},
				})
			},


		}
	}
</script>


<style scoped>
</style>